#ifndef _ENESIM_SINK_H_
#define _ENESIM_SINK_H_

#include <gst/gst.h>
#include <gst/video/gstvideosink.h>

#include <Enesim.h>

#include "gst_enesim_buffer.h"

#define GST_TYPE_ENESIM_SINK \
  (gst_enesim_sink_get_type())
#define GST_ENESIM_SINK(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_ENESIM_SINK, GstEnesimSink))
#define GST_ENESIM_SINK_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_ENESIM_SINK, GstEnesimSinkClass))
#define GST_IS_ENESIM_SINK(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_ENESIM_SINK))
#define GST_IS_ENESIM_SINK_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_ENESIM_SINK))


typedef struct _GstEnesimSink
{
  GstVideoSink videosink;
  GstEnesimBuffer *last_buffer;
  Enesim_Buffer_Format format;
  Enesim_Pool *pool;
  int32_t final_width;
  int32_t final_height;
} GstEnesimSink;

typedef struct _GstEnesimSinkClass
{
  GstVideoSinkClass parent_class;
  void (*buffer_display) (GstEnesimSink *sink, Enesim_Buffer *buffer);
} GstEnesimSinkClass;


GType gst_enesim_sink_get_type (void);

#endif
